package com.hgw.springsecurityjwtdemo02.controller;

import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Description: 权限测试Controller
 * Data time:2022/9/2 16:05
 * Author:TQ-3038-HuangGongWei
 */
@RestController
@RequestMapping("test")
public class AuthorizationTestController {

    @RequestMapping("/background")
    @PreAuthorize("hasAnyAuthority('system:background:list')")
    public String background() {
        return "后台管理系统";
    }

    @RequestMapping("/foreground")
    @PreAuthorize("hasAnyAuthority('system:foreground:list')")
    public String foreground() {
        return "前台";
    }
}
